﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>收货地址 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link rel="stylesheet" type="text/css" href="{config.webpath}css/validate.css" />
<link rel="stylesheet" type="text/css" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery.form.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/PCASClass.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/common.js"></script>
<script type="text/javascript">
    $(function(){
        //初始化表单
        AjaxInitForm('#editForm', '#btnSubmit', 1, '#turl');
    });
</script>
</head>

<body>
<!--页面头部-->
<%template src="_header.html"%>
<!--/页面头部-->

<!--当前位置-->
<div class="section">
    <div class="location">
        <span>当前位置：</span>
        <a href="<%linkurl("index")%>">首页</a> &gt;
        <a href="<%linkurl("usercenter","index")%>">会员中心</a>
        <a href="<%linkurl("usermessage","list")%>">站内短消息</a>
    </div>
</div>
<!--/当前位置-->

<div class="section clearfix">
    <!--页面左边-->
    <%template src="_ucenter_nav.html"%>
    <!--/页面左边-->
    
    <!--页面左边-->
    <div class="right-auto">
        <div class="bg-wrap" style="min-height:765px;">
            
            <div class="sub-tit">
                <a class="add" href="javascript:history.back();"><i class="iconfont icon-reply"></i>返回</a>
                <ul>
                    <li class="selected">
                        <a href="<%linkurl("useraddress")%>">收货地址</a>
                    </li>
                </ul>
            </div>
            
            <%if(action=="edit")%>
            <!--编辑地址-->
            <script type="text/javascript">
            $(function(){
                //初始化地区
                var mypcas = new PCAS("txtProvince,所属省份", "txtCity,所属城市", "txtArea,所属地区");
                var areaArr = ("{model.area}").split(",");
                if (areaArr.length == 3) {
                    mypcas.SetValue(areaArr[0], areaArr[1], areaArr[2]);
                }
            });
            </script>
            <form id="editForm" name="editForm" url="{config.webpath}tools/submit_ajax.ashx?action=user_address_edit&id={model.id}">
                <div class="form-box">
                    <dl class="form-group">
                        <dt>收件人姓名：</dt>
                        <dd>
                            <input name="txtAcceptName" id="txtAcceptName" type="text" class="input" value="{model.accept_name}" datatype="s1-50"  nullmsg="请填写收件人用户名" sucmsg=" " />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>所属地区：</dt>
                        <dd>
                            <select id="txtProvince" name="txtProvince" class="select"></select>
                            <select id="txtCity" name="txtCity" class="select"></select>
                            <select id="txtArea" name="txtArea" class="select" datatype="*" nullmsg="请选择所属地区" sucmsg=" "></select>
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>详细地址：</dt>
                        <dd>
                            <input name="txtAddress" id="txtAddress" type="text" class="input" value="{model.address}" datatype="*1-255" nullmsg="请填写详细地址" sucmsg=" " />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>手机号码：</dt>
                        <dd>
                            <input name="txtMobile" id="txtMobile" type="text" class="input" value="{model.mobile}" datatype="m" nullmsg="请填写手机号码" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>联系电话：</dt>
                        <dd>
                            <input name="txtTelphone" id="txtTelphone" type="text" class="input" value="{model.telphone}" maxlength="30" datatype="*0-20" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>电子邮箱：</dt>
                        <dd>
                            <input name="txtEmail" id="txtEmail" type="text" class="input" value="{model.email}" datatype="*0-20" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>邮政编码：</dt>
                        <dd>
                            <input name="txtPostCode" id="txtPostCode" type="text" class="input" value="{model.post_code}" datatype="n0-10" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>验 证 码：</dt>
                        <dd>
                            <input id="txtCode" name="txtCode" type="text" class="input code" placeholder="输入验证码" datatype="s4-20" nullmsg="请输入右边显示的验证码" sucmsg=" " />
                            <a class="send" href="javascript:;" onclick="ToggleCode(this, '{config.webpath}tools/verify_code.ashx');return false;">
                              <img src="{config.webpath}tools/verify_code.ashx" width="80" height="22" /> 看不清楚？
                            </a>
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dd>
                            <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit" />
                        </dd>
                    </dl>
                </div>
            </form>
            
            <!--/编辑地址-->
            
            <%else%>
            <!--新增地址-->
            <script type="text/javascript">
            $(function(){
                //初始化地区
                var mypcas = new PCAS("txtProvince,所属省份", "txtCity,所属城市", "txtArea,所属地区");
            });
            </script>
            <form id="editForm" name="editForm" url="{config.webpath}tools/submit_ajax.ashx?action=user_address_edit">
                <div class="form-box">
                    <dl class="form-group">
                        <dt>收件人姓名：</dt>
                        <dd>
                            <input name="txtAcceptName" id="txtAcceptName" type="text" class="input" datatype="s1-50"  nullmsg="请填写收件人用户名" sucmsg=" " />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>所属地区：</dt>
                        <dd>
                            <select id="txtProvince" name="txtProvince" class="select"></select>
                            <select id="txtCity" name="txtCity" class="select"></select>
                            <select id="txtArea" name="txtArea" class="select" datatype="*" nullmsg="请选择所属地区" sucmsg=" "></select>
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>详细地址：</dt>
                        <dd>
                            <input name="txtAddress" id="txtAddress" type="text" class="input" maxlength="255" datatype="*0-255" nullmsg="请填写详细地址" sucmsg=" " />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>手机号码：</dt>
                        <dd>
                            <input name="txtMobile" id="txtMobile" type="text" class="input" maxlength="30" datatype="m" nullmsg="请填写手机号码" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>联系电话：</dt>
                        <dd>
                            <input name="txtTelphone" id="txtTelphone" type="text" class="input" maxlength="30" datatype="*0-20" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>电子邮箱：</dt>
                        <dd>
                            <input name="txtEmail" id="txtEmail" type="text" class="input" maxlength="30" datatype="*0-30" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>邮政编码：</dt>
                        <dd>
                            <input name="txtPostCode" id="txtPostCode" type="text" class="input" maxlength="30" datatype="n0-10" sucmsg=" "  />
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dt>验 证 码：</dt>
                        <dd>
                            <input id="txtCode" name="txtCode" type="text" class="input code" placeholder="输入验证码" datatype="s4-20" nullmsg="请输入右边显示的验证码" sucmsg=" " />
                            <a class="send" href="javascript:;" onclick="ToggleCode(this, '{config.webpath}tools/verify_code.ashx');return false;">
                              <img src="{config.webpath}tools/verify_code.ashx" width="80" height="22" /> 看不清楚？
                            </a>
                        </dd>
                    </dl>
                    <dl class="form-group">
                        <dd>
                            <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit" />
                        </dd>
                    </dl>
                </div>
            </form>
            <!--新增地址-->
            <%/if%>
            
            <input id="turl" type="hidden" value="<%linkurl("useraddress")%>" /><!--存在跳转的URL值-->
        </div>
    </div>
    <!--/页面左边-->
</div>

<!--页面底部-->
<%template src="_footer.html"%>
<!--/页面底部-->
</body>
</html>